package br.com.upper.action;

import java.util.Date;

import br.com.upper.business.Facade;
import br.com.upper.entity.TestResult;

public class Index extends UpperSupport {
	
	private String nome;
	
	@Override
	public String execute() throws Exception {		
		
		if(isPostMethod()) {
			
			if(this.nome != null && !this.nome.trim().equalsIgnoreCase("")) {
				
				TestResult result = new TestResult();
				result.setTesterName(this.nome);
				getSessionMap().put("testResult", result);
				Facade.getInstance().saveTestResult(result);
				Facade.getInstance().deleteAllTransactions();
				
				return "config";				
			}

			return SUCCESS;
			
		} else {
					
			return SUCCESS;
			
		}

	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}
	
	
	
}
